﻿namespace MefContrib.Models.Provider
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;

    /// <summary>
    /// Defines an abstract description of an part.
    /// </summary>
    public class PartDescription
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PartDescription"/> class.
        /// </summary>
        public PartDescription()
            : this(null, null, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PartDescription"/> class, using
        /// the provided initial values.
        /// </summary>
        /// <param name="typeName">The name of the type that the part is associated with.</param>
        /// <param name="exports">The exports that are defined by the part.</param>
        /// <param name="imports">The imports that are defined by the part.</param>
        public PartDescription(string typeName, Collection<ExportDescription> exports, Collection<ImportDescription> imports)
        {
            this.Exports = exports;
            this.Imports = imports;
            this.TypeName = typeName;
        }

        /// <summary>
        /// Gets or sets the imports associated with the part.
        /// </summary>
        /// <value>An <see cref="IEnumerable{T}"/> object.</value>
        public Collection<ExportDescription> Exports { get; set; }

        /// <summary>
        /// Gets or sets the exports associated with the part.
        /// </summary>
        /// <value>An <see cref="IEnumerable{T}"/> object.</value>
        public Collection<ImportDescription> Imports { get; set; }

        /// <summary>
        /// Gets or sets the name of the type the part is assocated with.
        /// </summary>
        /// <value>A <see cref="String"/> containing the name the part is associated with.</value>
        public string TypeName { get; set; }
    }
}